﻿@using Ext.Net
@using Ext.Net.MVC
@model DoAnForum.Models.ProfileModel
@{
    ViewBag.Title = "Profile";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
    var currUser = Membership.GetUser() != null ? Membership.GetUser().UserName.ToUpper(): null;
    var compareUser = Model.UserName.ToUpper();
}

@{
    var logo = "../.." + Model.Avatar;
    var createdate = Model.CreateDate.ToShortDateString();
    var birthday = Model.Birthday.ToShortDateString();
}

<div class="profileBox">
    <div class="profile-left">
        <span class="profileName label label-info">@Model.UserName</span>
        <img src=@logo alt=@Model.UserName title=@Model.UserName>
        <p>Ngày tham gia: @createdate</p>
        <p> Số lượng bài viết: @Model.Post bài</p>
    </div>
    <div class="profile-right">
        @if (compareUser.Equals(currUser))
        {
            <div class="btn-group" style="margin-bottom: 50px;">
                <a href=@Url.Action("ChangePassword", "Account") target="_self" class="btn btn-info btn-large">Đổi mật khẩu</a>
                <a href=@Url.Action("EditProfile", "Account") target="_self" class="btn btn-info btn-large">Sửa Profile</a>
            </div>
            <p><span class="span2">Ngày sinh:</span>           <span class="span3">@birthday</span></p>
            <br/>
            <p><span class="span2">Email:</span>           <span class="span3">@Model.Email</span></p>
            <br/>
            <p><span class="span2">Loại thành viên:</span>           <span class="span3">@Model.Role</span></p>
        }
        @if (!compareUser.Equals(currUser))
        {
            <span class="profileInfo label label-info">Thông tin cá nhân</span>
            <p><span class="span2">Ngày sinh:</span>           <span class="span3">@birthday</span></p>
            <br/>
            <p><span class="span2">Email:</span>           <span class="span3">@Model.Email</span></p>
            <br/>
            <p><span class="span2">Loại thành viên:</span>           <span class="span3">@Model.Role</span></p>
        }
    </div>
</div>

